﻿namespace PrismEx.SampleApp
{
    using System.Linq;
    using System.Reflection;

    public static class AssemblyInfoHelper
    {
        public static string CompanyName
        {
            get
            {
                var companyAttribute = Assembly.GetExecutingAssembly().GetCustomAttributes(false).FirstOrDefault(a => a is AssemblyCompanyAttribute) as AssemblyCompanyAttribute;
                return companyAttribute != null ? companyAttribute.Company : string.Empty;
            }
        }

        public static string ProductName
        {
            get
            {
                var productAttribute = Assembly.GetExecutingAssembly().GetCustomAttributes(false).FirstOrDefault(a => a is AssemblyProductAttribute) as AssemblyProductAttribute;
                return productAttribute != null ? productAttribute.Product : string.Empty;
            }
        }

        public static string CopyrightText
        {
            get
            {
                var copyrightAttribute = Assembly.GetExecutingAssembly().GetCustomAttributes(false).FirstOrDefault(a => a is AssemblyCopyrightAttribute) as AssemblyCopyrightAttribute;
                return copyrightAttribute != null ? copyrightAttribute.Copyright : string.Empty;
            }
        }
    }
}